<?php

namespace app\admin\model;

use think\Db;
use think\Model;

class UserModel extends Model
{
    protected $table="user";
    /*
     * 删除
     */
    public function del_user($id){
        $user=UserModel::get($id);
        if(empty($user)){
            return array("code"=>0,"msg"=>"信息有误");
        }
        $data=Db::name("user")->where("id",$id)->update(["status"=>0,"rective"=>0]);
        if ($data){
            return array("code"=>1,"msg"=>"删除成功");
        }else{
            return array("code"=>0,"msg"=>"删除失败");
        }
    }


}
